package com.baidu.littlepainter

import android.os.Bundle
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.baidu.littlepainter.databinding.ActivityMainBinding
import com.baidu.littlepainter.utils.FragmentType
import com.baidu.littlepainter.utils.LoginRegisterResult
import com.baidu.littlepainter.utils.PasswordType
import com.baidu.littlepainter.viewmodel.MainViewModel

class MainActivity : BaseActivity<ActivityMainBinding>() {
    private val viewModel:MainViewModel by viewModels()

    override fun initBinding(): ActivityMainBinding {
        return ActivityMainBinding.inflate(layoutInflater)
    }

    override fun initView() {
        viewModel.currentFragmentType.observe(this) {
            if (it == FragmentType.LOGIN) {
                mBinding.tvTitle.text = resources.getString(R.string.welcome_home)
                mBinding.tvSubtitle.text = resources.getString(R.string.welcome_subtitle)
            } else {
                mBinding.tvTitle.text = resources.getString(R.string.register_title)
                mBinding.tvSubtitle.text = resources.getString(R.string.register_subtitle)
            }
        }
    }
}